$(document).ready(function() {
	$(".chzn-select").chosen();
	var editUrl = __ctxPath+"/system/json_get_sys_user.do",
		delUrl = __ctxPath+"/system/json_del_sys_user.do",
		fieldArray = ['userId','userName','password','firstName','lastName','.chzn-select'],
		editArray = ['userName','password','firstName','lastName','.chzn-select'];
	initPage('listPanel','detailPanel',editUrl,delUrl,fieldArray,editArray,afterLoadFn);
});
function afterLoadFn(result){
	roles = result.roles;
	var chosen = $(".chzn-select");
	chosen.children("option:selected").attr("selected",false);
	for(var i=0;i<roles.length;i++){
		var r = roles[i];
		$("#userRoles option[value='"+r.roleId+"']").attr("selected",true);
	}
	chosen.trigger("liszt:updated");
};
